﻿<form id="system-user-info-form" lay-filter="system-user-info-form" class="layui-form model-form">
    <input name="id" type="hidden"/>
    <input name="createTime" type="hidden"/>
    <input name="state" type="hidden" value="1"/>
    <div class="layui-form-item">
        <label class="layui-form-label">账号</label>
        <div class="layui-input-block">
            <input name="account" placeholder="请输入账号" type="text" class="layui-input" maxlength="20"
                   lay-verify="required" required/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-block">
            <input name="name" placeholder="请输入用户名" type="text" class="layui-input" maxlength="20"
                   lay-verify="required" required/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号</label>
        <div class="layui-input-block">
            <input name="mobile" placeholder="请输入手机号" type="text" class="layui-input" lay-verify="required|phone"
                   required/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">微信</label>
        <div class="layui-input-block">
            <input name="wechat" placeholder="请输入微信号" type="text" class="layui-input" />
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">QQ</label>
        <div class="layui-input-block">
            <input name="qq" placeholder="请输入qq号" type="text" class="layui-input"
            />
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-block">
            <input type="radio" name="sex" value="1" title="男" checked/>
            <input type="radio" name="sex" value="0" title="女"/>
        </div>
    </div>
    <div  style="display: none">
        <button class="layui-btn" lay-filter="system-user-info-submit" id = "system-user-info-submit" lay-submit>保存</button>
    </div>
</form>

<script>
    layui.use(['layer', 'form',  'admin','util','config'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var admin = layui.admin;
        var config = layui.config;
        var util = layui.util;
        form.render("radio","system-user-info-form");
        var url = 'system/user/modifyInfo';  //实际项目这里是添加用户的url
        // 回显user数据
        var user = config.getUser()
        $('#system-user-info-form input[name="account"]').attr('readonly', 'readonly');
        form.val('system-user-info-form', user);

        // 表单提交事件
        form.on('submit(system-user-info-submit)', function (data) {
            layer.close(layer.curr_idex)
            return false;
        });
    });
</script>

</body>
</html>